package com.lichuang.dedao.user.controller;

import com.lichuang.dedao.user.entity.History;
import com.lichuang.dedao.user.enums.CollectionType;
import com.lichuang.dedao.user.service.impl.HistoryServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 历史记录 前端控制器
 * </p>
 *
 * @author hanghang
 * @since 2019-07-14
 */
@RestController
@RequestMapping("//history")
public class HistoryController {

    @Autowired
    private HistoryServiceImpl historyService;

    @RequestMapping("/addHistory")
    public List<History> addHistory(Integer userId, CollectionType collectionType, Integer objectId, String objectName) {
        return historyService.addHistory(userId, collectionType, objectId, objectName);
    }

    @RequestMapping("/selectHistories")
    public List<History> selectHistories(Integer userId) {
        return historyService.selectHistories(userId);
    }

}
